package com.ty.controller;

import com.ty.dto.product.Product;
import com.ty.service.ProductService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/product")
@Slf4j
public class ProductController {

    @Autowired
    ProductService productService;
    @GetMapping
    public Product select(@RequestParam Integer id){
        log.debug("查询商品信息{}",id);
        return productService.select(id);
    }
}
